﻿@using (var e = Html.TypeContext<ValueLineBoxModel>())
{
    if (e.Value.TopText.HasText())
    {
        @e.Value.TopText 
        <div class='clearall'></div>
    }
    @Html.HiddenRuntimeInfo(e, f => f.Related)
    <div style="display: none">
    
        @Html.ValueLine(e, f => f.BoxType)
    </div>
    switch (e.Value.BoxType)
    {
        case ValueLineBoxType.Boolean:
            @Html.ValueLine(e, f => f.BoolValue, vl => vl.LabelText = e.Value.FieldName)
            break;
        case ValueLineBoxType.Integer:
            @Html.ValueLine(e, f => f.IntValue, vl => vl.LabelText = e.Value.FieldName)
            break;
        case ValueLineBoxType.Decimal:
            @Html.ValueLine(e, f => f.DecimalValue, vl => vl.LabelText = e.Value.FieldName)
            break;
        case ValueLineBoxType.DateTime:
            @Html.ValueLine(e, f => f.DateValue, vl => vl.LabelText = e.Value.FieldName)
            break;
        case ValueLineBoxType.String:
            @Html.ValueLine(e, f => f.StringValue, vl => vl.LabelText = e.Value.FieldName)
            break;
        default:
            throw new InvalidOperationException("ValueLineBoxType {0} does not exist".Formato(e.Value.BoxType));
    }
} 